import { SALESMANS } from '../consts.js'
import axios from '../axios.js'
export default {
  //新增销售员
  salesmansAdd(data) {
    return axios({
      url: SALESMANS + '/salesmansAdd',
      method: 'post',
      data
    })
  },
  //获取销售员
  getSalesmans(params) {

    return axios({
      url: SALESMANS + '/salesmansRend',
      method: 'get',
      params

    })
  },
   //通过_id查询销售员信息，并渲染到页面上
   getSalesmansById(data)
   {
       return axios({
           url:SALESMANS + '/salesmansUpdata',
           method:'post',
           data
       })
   },
    //修改销售员信息
    modifySalesmansById(data)
    {  
       return axios({
           url:SALESMANS + '/salesmansModifyById',
           method:'post',
           data

       })
    },
    //通过_id删除销售员
    getSalesmansDeleteById(data)
    {
      return axios({
        url:SALESMANS + '/getSalesmansDeleteById',
        method:'post',
        data
      })
    },
    //-------胡兴泽
    //由id获取销售员
    receiveSalesmanById(data){
      return axios({
        url:SALESMANS + '/receiveSalesmanById',
        method:'get',
        params:data
      })
    }
}
